repositories {
    mavenCentral()
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'jetty'
apply plugin: 'eclipse'
apply plugin: 'project-report'

sourceCompatibility = 1.6
targetCompatibility = 1.6
version = '1.0'

sourceSets {
    main {
        java {
            srcDir '<%= Configuration::MAIN_SRC %>'
        }
        resources {
            srcDir '<%= Configuration::MAIN_RESOURCES %>'
        }
    }
    test {
        java {
            srcDir '<%= Configuration::TEST_SRC %>'
        }
        resources {
            srcDir '<%= Configuration::TEST_RESOURCES %>'
        }
    }
}

sourceSets.main.classesDir = new File('<%= Configuration::WEB_INF %>/classes')

jettyRun.scanIntervalSeconds=3
jettyRun.contextPath = '/'
[jettyRunWar,jettyStop]*.stopPort = 8081
[jettyRunWar,jettyStop]*.stopKey = 'stopKey'

dependencies {
<% @dependencies.compile_scope.each do |dependency| -%>
    compile group: '<%= dependency.group %>', name: '<%= dependency.name %>', version: '<%= dependency.version %>'<% if dependency.has_exclusions? %>, {<% dependency.exclusions.each do |exclusion| %>
        exclude group: '<%= exclusion.group %>', name: '<%= exclusion.name %>'<% end %>
    }<% end %>
<% end -%>

    //Provided dependencies
<% @dependencies.provided_scope.each do |dependency| -%>
    providedCompile group: '<%= dependency.group %>', name: '<%= dependency.name %>', version: '<%= dependency.version %>'
<% end -%>

    //Test dependencies
<% @dependencies.test_scope.each do |dependency| -%>
    testCompile group: '<%= dependency.group %>', name: '<%= dependency.name %>', version: '<%= dependency.version %>'
<% end -%>
}
